<?php

namespace App\Logic;

use App\Common\Third\ChatGPT\OpenChatAi;
use Hyperf\Context\ApplicationContext;

class ChatLogic
{
    
    public function chatStream(array $params = [])
    {
        // ApplicationContext::getContainer()->get(OpenChatAi::class)->chatStream($params); // 通过前端 new EventSource() 不可行
        ApplicationContext::getContainer()->get(OpenChatAi::class)->chatWithStream($params); // 此方法可以
    }

}